.class public Lmobi/intuitit/android/widget/ScrollableWidgetProvider;
.super Landroid/content/BroadcastReceiver;
.source "ScrollableWidgetProvider.java"

# interfaces
.implements Landroid/widget/AbsListView$OnScrollListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lmobi/intuitit/android/widget/ScrollableWidgetProvider$WidgetItemListener;,
        Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    }
.end annotation


# static fields
.field private static final CLEAR_DATA_CACHE:Z = false

.field private static final FORCE_FREE_MEMORY:Z = false

.field private static final TAG:Ljava/lang/String; = "ScrollableWidgetProvider"

.field static mScrollViewCursorInfos:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field protected mAllowLongPress:Z

.field private mElementArrList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/nemustech/regina/ElementAndroidWidget;",
            ">;"
        }
    .end annotation
.end field

.field private mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

.field protected mSnapshotTrigger:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 50
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    return-void
.end method

.method public constructor <init>(Lcom/nemustech/regina/ReginaLauncher;)V
    .locals 1
    .parameter "reginaLauncher"

    .prologue
    .line 87
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    .line 46
    const/4 v0, 0x0

    iput-boolean v0, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mSnapshotTrigger:Z

    .line 88
    iput-object p1, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    .line 89
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mElementArrList:Ljava/util/ArrayList;

    .line 90
    return-void
.end method

.method static synthetic access$000(Lmobi/intuitit/android/widget/ScrollableWidgetProvider;)Lcom/nemustech/regina/ReginaLauncher;
    .locals 1
    .parameter "x0"

    .prologue
    .line 38
    iget-object v0, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    return-object v0
.end method

.method private findElement(Landroid/view/View;)Lcom/nemustech/regina/ElementAndroidWidget;
    .locals 7
    .parameter "view"

    .prologue
    .line 451
    const/4 v4, 0x0

    .line 452
    .local v4, resultElement:Lcom/nemustech/regina/ElementAndroidWidget;
    iget-object v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 453
    .local v1, cnt:I
    const/4 v3, 0x0

    .local v3, i:I
    :goto_0
    if-ge v3, v1, :cond_0

    .line 454
    iget-object v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v5, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/regina/ElementAndroidWidget;

    .line 455
    .local v0, aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementAndroidWidget;->getHostView()Landroid/appwidget/AppWidgetHostView;

    move-result-object v2

    .line 456
    .local v2, hostView:Landroid/view/View;
    invoke-virtual {v2, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v5

    const/4 v6, 0x1

    if-ne v5, v6, :cond_1

    .line 457
    move-object v4, v0

    .line 462
    .end local v0           #aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    .end local v2           #hostView:Landroid/view/View;
    :cond_0
    return-object v4

    .line 453
    .restart local v0       #aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    .restart local v2       #hostView:Landroid/view/View;
    :cond_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method private findWidget(I)Landroid/appwidget/AppWidgetHostView;
    .locals 7
    .parameter "widgetId"

    .prologue
    .line 466
    iget-object v6, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v6}, Lcom/nemustech/regina/ReginaLauncher;->getElementLocator()Lcom/nemustech/regina/ElementLocator;

    move-result-object v5

    .line 467
    .local v5, locator:Lcom/nemustech/regina/ElementLocator;
    invoke-virtual {v5}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceHolder()Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v6

    invoke-virtual {v6}, Lcom/nemustech/tiffany/world/TFHolder;->getItemCount()I

    move-result v2

    .line 469
    .local v2, count:I
    const/4 v4, 0x0

    .local v4, i:I
    :goto_0
    if-ge v4, v2, :cond_1

    .line 470
    invoke-virtual {v5, v4}, Lcom/nemustech/regina/ElementLocator;->getWorkspace(I)Lcom/nemustech/regina/RGWorkspace;

    move-result-object v6

    invoke-virtual {v6, p1}, Lcom/nemustech/regina/RGWorkspace;->findElementByAppWidgetId(I)Lcom/nemustech/regina/Element;

    move-result-object v3

    .line 471
    .local v3, element:Lcom/nemustech/regina/Element;
    if-eqz v3, :cond_0

    instance-of v6, v3, Lcom/nemustech/regina/ElementAndroidWidget;

    if-eqz v6, :cond_0

    .line 472
    move-object v0, v3

    check-cast v0, Lcom/nemustech/regina/ElementAndroidWidget;

    move-object v1, v0

    .line 474
    .local v1, aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    iget-object v6, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mElementArrList:Ljava/util/ArrayList;

    invoke-virtual {v6, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 475
    const/4 v6, 0x1

    invoke-virtual {v1, v6}, Lcom/nemustech/regina/ElementAndroidWidget;->setScrollableWidget(Z)V

    .line 476
    invoke-virtual {v1}, Lcom/nemustech/regina/ElementAndroidWidget;->getHostView()Landroid/appwidget/AppWidgetHostView;

    move-result-object v6

    .line 480
    .end local v1           #aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    .end local v3           #element:Lcom/nemustech/regina/Element;
    :goto_1
    return-object v6

    .line 469
    .restart local v3       #element:Lcom/nemustech/regina/Element;
    :cond_0
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 480
    .end local v3           #element:Lcom/nemustech/regina/Element;
    :cond_1
    const/4 v6, 0x0

    goto :goto_1
.end method

.method private getTopHostView(Landroid/view/View;)Landroid/view/View;
    .locals 2
    .parameter "view"

    .prologue
    .line 439
    const/4 v0, 0x0

    .line 441
    .local v0, resultView:Landroid/view/View;
    instance-of v1, p1, Landroid/appwidget/AppWidgetHostView;

    if-eqz v1, :cond_0

    .line 442
    move-object v0, p1

    move-object v1, v0

    .line 447
    :goto_0
    return-object v1

    .line 444
    :cond_0
    invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    check-cast v1, Landroid/view/View;

    invoke-direct {p0, v1}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->getTopHostView(Landroid/view/View;)Landroid/view/View;

    move-result-object v1

    goto :goto_0
.end method

.method private declared-synchronized makeScrollable(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;
    .locals 22
    .parameter "context"
    .parameter "intent"
    .parameter "widgetView"

    .prologue
    .line 146
    monitor-enter p0

    :try_start_0
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_VIEW_ID"

    const/4 v8, -0x1

    move-object/from16 v0, p2

    move-object v1, v7

    move v2, v8

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v10

    .line 147
    .local v10, dummyViewId:I
    if-gtz v10, :cond_0

    .line 148
    const-string v7, "Dummy view id needed."
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 278
    .end local p1
    :goto_0
    monitor-exit p0

    return-object v7

    .line 150
    .restart local p1
    :cond_0
    :try_start_1
    invoke-virtual/range {p3 .. p3}, Landroid/appwidget/AppWidgetHostView;->getAppWidgetInfo()Landroid/appwidget/AppWidgetProviderInfo;

    move-result-object v7

    iget-object v8, v7, Landroid/appwidget/AppWidgetProviderInfo;->provider:Landroid/content/ComponentName;

    .line 151
    .local v8, appWidgetProvider:Landroid/content/ComponentName;
    invoke-virtual/range {p3 .. p3}, Landroid/appwidget/AppWidgetHostView;->getAppWidgetId()I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result v9

    .line 155
    .local v9, appWidgetId:I
    :try_start_2
    move-object/from16 v0, p0

    iget-object v0, v0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    move-object v7, v0

    invoke-virtual/range {p3 .. p3}, Landroid/appwidget/AppWidgetHostView;->getAppWidgetInfo()Landroid/appwidget/AppWidgetProviderInfo;

    move-result-object v11

    iget-object v11, v11, Landroid/appwidget/AppWidgetProviderInfo;->provider:Landroid/content/ComponentName;

    invoke-virtual {v11}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v11

    const/4 v12, 0x2

    invoke-virtual {v7, v11, v12}, Lcom/nemustech/regina/ReginaLauncher;->createPackageContext(Ljava/lang/String;I)Landroid/content/Context;

    move-result-object v6

    .line 159
    .local v6, remoteContext:Landroid/content/Context;
    const/16 v17, 0x0

    .line 161
    .local v17, lv:Landroid/widget/AbsListView;
    move-object/from16 v0, p3

    move v1, v10

    invoke-virtual {v0, v1}, Landroid/appwidget/AppWidgetHostView;->findViewById(I)Landroid/view/View;

    move-result-object v12

    .line 162
    .local v12, dummyView:Landroid/view/View;
    if-nez v12, :cond_1

    .line 163
    const-string v7, "Dummy view needed."

    goto :goto_0

    .line 165
    :cond_1
    instance-of v7, v12, Landroid/widget/AbsListView;

    if-eqz v7, :cond_5

    .line 166
    move-object v0, v12

    check-cast v0, Landroid/widget/AbsListView;

    move-object/from16 v17, v0

    .line 200
    :cond_2
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_DATA_URI"

    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    .line 202
    .local v11, cursorDataUriString:Ljava/lang/String;
    sget-object v7, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v7, v11}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v15

    check-cast v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;

    .line 205
    .local v15, listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    if-nez v15, :cond_b

    .line 207
    new-instance v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;

    .end local v15           #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    move-object v0, v15

    move-object/from16 v1, p0

    invoke-direct {v0, v1}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;-><init>(Lmobi/intuitit/android/widget/ScrollableWidgetProvider;)V

    .line 210
    .restart local v15       #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_ITEM_LAYOUT_REMOTEVIEWS"

    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_a

    .line 211
    new-instance v5, Lmobi/intuitit/android/widget/WidgetRemoteViewsListAdapter;

    move-object/from16 v7, p2

    invoke-direct/range {v5 .. v10}, Lmobi/intuitit/android/widget/WidgetRemoteViewsListAdapter;-><init>(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ComponentName;II)V

    .line 218
    .local v5, lvAdapter:Landroid/widget/BaseAdapter;
    :goto_1
    new-instance v21, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$1;

    move-object/from16 v0, v21

    move-object/from16 v1, p0

    move-object v2, v5

    invoke-direct {v0, v1, v2}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$1;-><init>(Lmobi/intuitit/android/widget/ScrollableWidgetProvider;Landroid/widget/BaseAdapter;)V

    .line 229
    .local v21, widgetDataChangeListener:Lmobi/intuitit/android/widget/WidgetDataChangeListener;
    new-instance v7, Lmobi/intuitit/android/widget/WidgetContentObserver;

    iget-object v12, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obsHandler:Landroid/os/Handler;

    .end local v12           #dummyView:Landroid/view/View;
    move-object v0, v7

    move-object v1, v12

    move-object/from16 v2, v21

    invoke-direct {v0, v1, v2}, Lmobi/intuitit/android/widget/WidgetContentObserver;-><init>(Landroid/os/Handler;Lmobi/intuitit/android/widget/WidgetDataChangeListener;)V

    iput-object v7, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obs:Landroid/database/ContentObserver;

    .line 231
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_DATA_URI"

    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v20

    .line 233
    .local v20, uriToObserver:Landroid/net/Uri;
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v7

    const/4 v12, 0x1

    iget-object v13, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obs:Landroid/database/ContentObserver;

    move-object v0, v7

    move-object/from16 v1, v20

    move v2, v12

    move-object v3, v13

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 237
    iput-object v5, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lvAdapter:Landroid/widget/BaseAdapter;

    .line 239
    const-string v7, "ScrollableWidgetProvider"

    const-string v12, "makeScrollable : recreate listview adapter"

    const/4 v13, 0x1

    invoke-static {v7, v12, v13}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 244
    .end local v5           #lvAdapter:Landroid/widget/BaseAdapter;
    .end local v20           #uriToObserver:Landroid/net/Uri;
    .end local v21           #widgetDataChangeListener:Lmobi/intuitit/android/widget/WidgetDataChangeListener;
    :goto_2
    iget-object v7, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lvAdapter:Landroid/widget/BaseAdapter;

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->setAdapter(Landroid/widget/Adapter;)V

    .line 247
    iget-object v7, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lvAdapter:Landroid/widget/BaseAdapter;

    instance-of v7, v7, Lmobi/intuitit/android/widget/ScrollableWidgetAdapter;

    if-eqz v7, :cond_3

    move-object v0, v15

    iget-object v0, v0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lvAdapter:Landroid/widget/BaseAdapter;

    move-object/from16 p1, v0

    .end local p1
    check-cast p1, Lmobi/intuitit/android/widget/ScrollableWidgetAdapter;

    move-object/from16 v0, p1

    iget-boolean v0, v0, Lmobi/intuitit/android/widget/ScrollableWidgetAdapter;->mItemChildrenClickable:Z

    move v7, v0

    if-nez v7, :cond_3

    .line 249
    new-instance v7, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$WidgetItemListener;

    move-object v0, v7

    move-object/from16 v1, p0

    move-object v2, v8

    move v3, v9

    move v4, v10

    invoke-direct {v0, v1, v2, v3, v4}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$WidgetItemListener;-><init>(Lmobi/intuitit/android/widget/ScrollableWidgetProvider;Landroid/content/ComponentName;II)V

    move-object/from16 v0, v17

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 251
    :cond_3
    const/4 v7, 0x0

    move-object/from16 v0, v17

    move v1, v7

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->setFocusableInTouchMode(Z)V

    .line 252
    move-object/from16 v0, v17

    move-object/from16 v1, p0

    invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V

    .line 255
    iput v9, v15, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->widgetId:I

    .line 256
    move-object/from16 v0, v17

    move-object v1, v15

    iput-object v0, v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;

    .line 257
    sget-object v7, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v7, v11, v15}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 260
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_LISTVIEW_POSITION"

    const/4 v8, -0x1

    move-object/from16 v0, p2

    move-object v1, v7

    move v2, v8

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    .end local v8           #appWidgetProvider:Landroid/content/ComponentName;
    move-result v18

    .line 262
    .local v18, position:I
    if-ltz v18, :cond_4

    .line 263
    invoke-virtual/range {v17 .. v18}, Landroid/widget/AbsListView;->setSelection(I)V

    .line 276
    :cond_4
    const/4 v7, 0x0

    goto/16 :goto_0

    .line 168
    .end local v11           #cursorDataUriString:Ljava/lang/String;
    .end local v15           #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    .end local v18           #position:I
    .restart local v8       #appWidgetProvider:Landroid/content/ComponentName;
    .restart local v12       #dummyView:Landroid/view/View;
    .restart local p1
    :cond_5
    const/4 v12, 0x0

    .line 169
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_LISTVIEW_REMOTEVIEWS"

    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_7

    .line 170
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_LISTVIEW_REMOTEVIEWS"

    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v19

    check-cast v19, Lmobi/intuitit/android/widget/SimpleRemoteViews;

    .line 171
    .local v19, rvs:Lmobi/intuitit/android/widget/SimpleRemoteViews;
    const/4 v7, 0x0

    move-object/from16 v0, v19

    move-object v1, v6

    move-object v2, v7

    invoke-virtual {v0, v1, v2}, Lmobi/intuitit/android/widget/SimpleRemoteViews;->apply(Landroid/content/Context;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v12

    .line 172
    instance-of v7, v12, Landroid/widget/AbsListView;

    if-eqz v7, :cond_6

    .line 173
    move-object v0, v12

    check-cast v0, Landroid/widget/AbsListView;

    move-object/from16 v17, v0

    .line 174
    move-object/from16 v0, p0

    move-object/from16 v1, p3

    move v2, v10

    move-object/from16 v3, v17

    invoke-virtual {v0, v1, v2, v3}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->replaceView(Landroid/view/ViewGroup;ILandroid/view/View;)Z

    move-result v7

    if-nez v7, :cond_2

    .line 175
    const-string v7, "Cannot replace the dummy with the list view inflated from the passed RemoteViews."

    goto/16 :goto_0

    .line 177
    :cond_6
    const-string v7, "could not create AbsListView from the passed RemoteViews"

    goto/16 :goto_0

    .line 180
    .end local v19           #rvs:Lmobi/intuitit/android/widget/SimpleRemoteViews;
    :cond_7
    const-string v7, "mobi.intuitit.android.hpp.EXTRA_LISTVIEW_LAYOUT_ID"

    const/4 v11, -0x1

    move-object/from16 v0, p2

    move-object v1, v7

    move v2, v11

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v16

    .line 182
    .local v16, listViewResId:I
    if-gtz v16, :cond_8

    .line 184
    move-object/from16 v0, p0

    move-object/from16 v1, p3

    move v2, v10

    invoke-virtual {v0, v1, v2}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->postListView(Landroid/appwidget/AppWidgetHostView;I)Landroid/widget/ListView;

    move-result-object v17

    .line 185
    if-nez v17, :cond_2

    .line 186
    const-string v7, "Cannot create the default list view."

    goto/16 :goto_0

    .line 189
    :cond_8
    invoke-static {v6}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v14

    .line 190
    .local v14, inflater:Landroid/view/LayoutInflater;
    const/4 v7, 0x0

    move-object v0, v14

    move/from16 v1, v16

    move-object v2, v7

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v12

    .line 191
    instance-of v7, v12, Landroid/widget/AbsListView;

    if-eqz v7, :cond_9

    .line 192
    move-object v0, v12

    check-cast v0, Landroid/widget/AbsListView;

    move-object/from16 v17, v0

    .line 193
    move-object/from16 v0, p0

    move-object/from16 v1, p3

    move v2, v10

    move-object/from16 v3, v17

    invoke-virtual {v0, v1, v2, v3}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->replaceView(Landroid/view/ViewGroup;ILandroid/view/View;)Z

    move-result v7

    if-nez v7, :cond_2

    .line 194
    const-string v7, "Cannot replace the dummy with the list view inflated from the passed layout resource id."

    goto/16 :goto_0

    .line 196
    :cond_9
    const-string v7, "Cannot inflate a list view from the passed layout resource id."

    goto/16 :goto_0

    .line 214
    .end local v14           #inflater:Landroid/view/LayoutInflater;
    .end local v16           #listViewResId:I
    .restart local v11       #cursorDataUriString:Ljava/lang/String;
    .restart local v15       #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    :cond_a
    new-instance v5, Lmobi/intuitit/android/widget/ScrollableWidgetAdapter;

    move-object/from16 v7, p2

    invoke-direct/range {v5 .. v10}, Lmobi/intuitit/android/widget/ScrollableWidgetAdapter;-><init>(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ComponentName;II)V

    .restart local v5       #lvAdapter:Landroid/widget/BaseAdapter;
    goto/16 :goto_1

    .line 241
    .end local v5           #lvAdapter:Landroid/widget/BaseAdapter;
    :cond_b
    const-string v7, "ScrollableWidgetProvider"

    const-string v12, "makeScrollable : restore listview adapter"

    .end local v12           #dummyView:Landroid/view/View;
    const/4 v13, 0x1

    invoke-static {v7, v12, v13}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto/16 :goto_2

    .line 277
    .end local v6           #remoteContext:Landroid/content/Context;
    .end local v8           #appWidgetProvider:Landroid/content/ComponentName;
    .end local v11           #cursorDataUriString:Ljava/lang/String;
    .end local v15           #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    .end local v17           #lv:Landroid/widget/AbsListView;
    .end local p1
    :catch_0
    move-exception v7

    move-object v13, v7

    .line 278
    .local v13, e:Ljava/lang/Exception;
    :try_start_3
    invoke-virtual {v13}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v7

    goto/16 :goto_0

    .line 146
    .end local v9           #appWidgetId:I
    .end local v10           #dummyViewId:I
    .end local v13           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v7

    monitor-exit p0

    throw v7
.end method

.method private declared-synchronized releaseScrollable(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;
    .locals 6
    .parameter "context"
    .parameter "intent"
    .parameter "widgetView"

    .prologue
    const/4 v5, 0x0

    .line 307
    monitor-enter p0

    :try_start_0
    const-string v3, "mobi.intuitit.android.hpp.EXTRA_DATA_URI"

    invoke-virtual {p2, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 309
    .local v0, cursorDataUriString:Ljava/lang/String;
    sget-object v3, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v3, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;

    .line 310
    .local v2, listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    if-eqz v2, :cond_0

    .line 311
    const/4 v3, 0x0

    iput-object v3, v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;

    .line 312
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    iget-object v4, v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obs:Landroid/database/ContentObserver;

    invoke-virtual {v3, v4}, Landroid/content/ContentResolver;->unregisterContentObserver(Landroid/database/ContentObserver;)V

    .line 313
    const/4 v3, 0x0

    iput-object v3, v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obsHandler:Landroid/os/Handler;

    .line 314
    const/4 v3, 0x0

    iput-object v3, v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->obs:Landroid/database/ContentObserver;

    .line 315
    sget-object v3, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v3, v0}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    move-object v3, v5

    .line 320
    .end local v0           #cursorDataUriString:Ljava/lang/String;
    .end local v2           #listViewInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    :goto_0
    monitor-exit p0

    return-object v3

    .line 318
    :catch_0
    move-exception v3

    move-object v1, v3

    .line 319
    .local v1, e:Ljava/lang/Exception;
    :try_start_1
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    .line 320
    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v3

    goto :goto_0

    .line 307
    .end local v1           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v3

    monitor-exit p0

    throw v3
.end method

.method private setSelection(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;
    .locals 6
    .parameter "context"
    .parameter "intent"
    .parameter "widgetView"

    .prologue
    .line 286
    :try_start_0
    const-string v4, "mobi.intuitit.android.hpp.EXTRA_DATA_URI"

    invoke-virtual {p2, v4}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 288
    .local v0, cursorDataUriString:Ljava/lang/String;
    const-string v4, "mobi.intuitit.android.hpp.EXTRA_LISTVIEW_POSITION"

    const/4 v5, 0x0

    invoke-virtual {p2, v4, v5}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v3

    .line 290
    .local v3, position:I
    sget-object v4, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v4, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;

    .line 291
    .local v1, cursorInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    if-eqz v1, :cond_0

    .line 292
    iget-object v4, v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;

    invoke-virtual {v4, v3}, Landroid/widget/AbsListView;->setSelection(I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 294
    :cond_0
    const/4 v4, 0x0

    .line 297
    .end local v0           #cursorDataUriString:Ljava/lang/String;
    .end local v1           #cursorInfos:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    .end local v3           #position:I
    :goto_0
    return-object v4

    .line 295
    :catch_0
    move-exception v4

    move-object v2, v4

    .line 296
    .local v2, e:Ljava/lang/Exception;
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    .line 297
    invoke-virtual {v2}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v4

    goto :goto_0
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 10
    .parameter "context"
    .parameter "intent"

    .prologue
    const/4 v8, -0x1

    .line 94
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    .line 95
    .local v0, action:Ljava/lang/String;
    const-string v5, "ScrollableWidgetProvider"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "onReceive: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    const/4 v7, 0x1

    invoke-static {v5, v6, v7}, Lcom/nemustech/regina/RLog;->i(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 98
    const-string v5, "appWidgetId"

    invoke-virtual {p2, v5, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v3

    .line 99
    .local v3, widgetId:I
    if-gez v3, :cond_0

    .line 100
    const-string v5, "mobi.intuitit.android.hpp.EXTRA_APPWIDGET_ID"

    invoke-virtual {p2, v5, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v3

    .line 101
    :cond_0
    if-gez v3, :cond_1

    .line 102
    const-string v5, "ScrollableWidgetProvider"

    const-string v6, "Scroll Provider cannot get a legal widget id"

    invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 140
    :goto_0
    return-void

    .line 106
    :cond_1
    invoke-direct {p0, v3}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->findWidget(I)Landroid/appwidget/AppWidgetHostView;

    move-result-object v4

    .line 108
    .local v4, widgetView:Landroid/appwidget/AppWidgetHostView;
    if-nez v4, :cond_2

    .line 109
    iget-object v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    const-string v6, "mobi.intuitit.android.hpp.ERROR_SCROLL_CURSOR"

    invoke-virtual {p2, v6}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v6

    const-string v7, "mobi.intuitit.android.hpp.EXTRA_ERROR_MESSAGE"

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "Cannot find app widget with id: "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v6

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaLauncher;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    .line 116
    :cond_2
    invoke-virtual {v4}, Landroid/appwidget/AppWidgetHostView;->getAppWidgetInfo()Landroid/appwidget/AppWidgetProviderInfo;

    move-result-object v5

    iget-object v1, v5, Landroid/appwidget/AppWidgetProviderInfo;->provider:Landroid/content/ComponentName;

    .line 118
    .local v1, appWidgetProvider:Landroid/content/ComponentName;
    const-string v2, "unknow action"

    .line 119
    .local v2, error:Ljava/lang/String;
    const-string v5, "mobi.intuitit.android.hpp.ACTION_SCROLL_WIDGET_START"

    invoke-static {v0, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 120
    invoke-direct {p0, p1, p2, v4}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->makeScrollable(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;

    move-result-object v2

    .line 129
    :cond_3
    :goto_1
    if-nez v2, :cond_7

    .line 131
    invoke-virtual {p2, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 132
    iget-object v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    const-string v6, "mobi.intuitit.android.hpp.ACTION_FINISH"

    invoke-virtual {p2, v6}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v6

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaLauncher;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    .line 121
    :cond_4
    const-string v5, "mobi.intuitit.android.hpp.ACTION_SCROLL_WIDGET_SELECT_ITEM"

    invoke-static {v0, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_5

    .line 123
    invoke-direct {p0, p1, p2, v4}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->setSelection(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;

    move-result-object v2

    goto :goto_1

    .line 124
    :cond_5
    const-string v5, "mobi.intuitit.android.hpp.ACTION_SCROLL_WIDGET_CLOSE"

    invoke-static {v0, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_6

    .line 125
    invoke-direct {p0, p1, p2, v4}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->releaseScrollable(Landroid/content/Context;Landroid/content/Intent;Landroid/appwidget/AppWidgetHostView;)Ljava/lang/String;

    move-result-object v2

    goto :goto_1

    .line 126
    :cond_6
    const-string v5, "mobi.intuitit.android.hpp.ACTION_SCROLL_WIDGET_CLEAR_IMAGE_CACHE"

    invoke-static {v0, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 127
    invoke-static {}, Lmobi/intuitit/android/widget/ListViewImageManager;->getInstance()Lmobi/intuitit/android/widget/ListViewImageManager;

    move-result-object v5

    invoke-virtual {v5, p1, v3}, Lmobi/intuitit/android/widget/ListViewImageManager;->clearCacheForWidget(Landroid/content/Context;I)Ljava/lang/String;

    move-result-object v2

    goto :goto_1

    .line 135
    :cond_7
    invoke-virtual {p2, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 136
    iget-object v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    const-string v6, "mobi.intuitit.android.hpp.ERROR_SCROLL_CURSOR"

    invoke-virtual {p2, v6}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v6

    const-string v7, "mobi.intuitit.android.hpp.EXTRA_ERROR_MESSAGE"

    invoke-virtual {v6, v7, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v6

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/ReginaLauncher;->sendBroadcast(Landroid/content/Intent;)V

    goto/16 :goto_0
.end method

.method public onScroll(Landroid/widget/AbsListView;III)V
    .locals 0
    .parameter "arg0"
    .parameter "arg1"
    .parameter "arg2"
    .parameter "arg3"

    .prologue
    .line 416
    return-void
.end method

.method public onScrollStateChanged(Landroid/widget/AbsListView;I)V
    .locals 6
    .parameter "view"
    .parameter "scrollState"

    .prologue
    const/4 v3, 0x0

    const/4 v5, 0x1

    .line 419
    if-nez p2, :cond_2

    move v2, v5

    :goto_0
    iput-boolean v2, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mAllowLongPress:Z

    .line 421
    iget-boolean v2, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mSnapshotTrigger:Z

    if-ne v2, v5, :cond_0

    if-nez p2, :cond_0

    .line 422
    iput-boolean v3, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mSnapshotTrigger:Z

    .line 423
    invoke-direct {p0, p1}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->getTopHostView(Landroid/view/View;)Landroid/view/View;

    move-result-object v1

    .line 424
    .local v1, topHostView:Landroid/view/View;
    invoke-direct {p0, v1}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->findElement(Landroid/view/View;)Lcom/nemustech/regina/ElementAndroidWidget;

    move-result-object v0

    .line 425
    .local v0, aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    if-eqz v0, :cond_0

    .line 426
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementAndroidWidget;->forceUpdatePanel()V

    .line 427
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementAndroidWidget;->getWorkspace()Lcom/nemustech/regina/RGWorkspace;

    move-result-object v2

    const/high16 v3, 0x3f00

    invoke-virtual {v2, v3}, Lcom/nemustech/regina/RGWorkspace;->updateThumb(F)V

    .line 431
    .end local v0           #aElement:Lcom/nemustech/regina/ElementAndroidWidget;
    .end local v1           #topHostView:Landroid/view/View;
    :cond_0
    if-lez p2, :cond_1

    .line 432
    iput-boolean v5, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mSnapshotTrigger:Z

    .line 435
    :cond_1
    const-string v2, "ScrollableWidgetProvider"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "onScrollStateChanged() scrollState="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3, v5}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 436
    return-void

    :cond_2
    move v2, v3

    .line 419
    goto :goto_0
.end method

.method postListView(Landroid/appwidget/AppWidgetHostView;I)Landroid/widget/ListView;
    .locals 2
    .parameter "widgetView"
    .parameter "dummyViewId"

    .prologue
    .line 380
    new-instance v0, Landroid/widget/ListView;

    iget-object v1, p0, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v1}, Landroid/widget/ListView;-><init>(Landroid/content/Context;)V

    .line 381
    .local v0, lv:Landroid/widget/ListView;
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setCacheColorHint(I)V

    .line 383
    invoke-virtual {p0, p1, p2, v0}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->replaceView(Landroid/view/ViewGroup;ILandroid/view/View;)Z

    move-result v1

    if-eqz v1, :cond_0

    move-object v1, v0

    .line 386
    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method replaceView(Landroid/view/ViewGroup;ILandroid/view/View;)Z
    .locals 5
    .parameter "vg"
    .parameter "id"
    .parameter "replacement"

    .prologue
    const/4 v4, 0x1

    .line 398
    const/4 v2, 0x0

    .line 399
    .local v2, result:Z
    invoke-virtual {p1}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v3

    sub-int v1, v3, v4

    .local v1, i:I
    :goto_0
    if-ltz v1, :cond_2

    .line 400
    invoke-virtual {p1, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 401
    .local v0, child:Landroid/view/View;
    invoke-virtual {v0}, Landroid/view/View;->getId()I

    move-result v3

    if-ne v3, p2, :cond_0

    .line 403
    invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    .line 405
    invoke-virtual {p3, p2}, Landroid/view/View;->setId(I)V

    .line 407
    invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v3

    invoke-virtual {p1, p3, v1, v3}, Landroid/view/ViewGroup;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

    move v3, v4

    .line 412
    .end local v0           #child:Landroid/view/View;
    :goto_1
    return v3

    .line 409
    .restart local v0       #child:Landroid/view/View;
    :cond_0
    instance-of v3, v0, Landroid/view/ViewGroup;

    if-eqz v3, :cond_1

    .line 410
    check-cast v0, Landroid/view/ViewGroup;

    .end local v0           #child:Landroid/view/View;
    invoke-virtual {p0, v0, p2, p3}, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->replaceView(Landroid/view/ViewGroup;ILandroid/view/View;)Z

    move-result v3

    or-int/2addr v2, v3

    .line 399
    :cond_1
    add-int/lit8 v1, v1, -0x1

    goto :goto_0

    :cond_2
    move v3, v2

    .line 412
    goto :goto_1
.end method

.method public declared-synchronized unbindWidgetScrollable()Z
    .locals 4

    .prologue
    .line 54
    monitor-enter p0

    :try_start_0
    sget-object v2, Lmobi/intuitit/android/widget/ScrollableWidgetProvider;->mScrollViewCursorInfos:Ljava/util/HashMap;

    invoke-virtual {v2}, Ljava/util/HashMap;->values()Ljava/util/Collection;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;

    .line 55
    .local v1, item:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    iget-object v2, v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;

    if-eqz v2, :cond_0

    .line 60
    iget-object v2, v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/AbsListView;->setAdapter(Landroid/widget/Adapter;)V

    .line 62
    :cond_0
    const/4 v2, 0x0

    iput-object v2, v1, Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;->lv:Landroid/widget/AbsListView;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    .line 54
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v1           #item:Lmobi/intuitit/android/widget/ScrollableWidgetProvider$ScrollViewInfos;
    :catchall_0
    move-exception v2

    monitor-exit p0

    throw v2

    .line 64
    .restart local v0       #i$:Ljava/util/Iterator;
    :cond_1
    :try_start_1
    invoke-static {}, Lmobi/intuitit/android/widget/ListViewImageManager;->getInstance()Lmobi/intuitit/android/widget/ListViewImageManager;

    move-result-object v2

    invoke-virtual {v2}, Lmobi/intuitit/android/widget/ListViewImageManager;->unbindDrawables()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 74
    const/4 v2, 0x0

    monitor-exit p0

    return v2
.end method
